Namespace Globals

    Module Globals

        Public strEquipLocationSearch As String

        Public Structure ServerOptions

            Dim Enable_PKDrops As Boolean

            Dim Enable_MobBagDrop As Boolean
            Dim Enable_MobBodyDrop As Boolean
            Dim Rate_MobBagDrop As Single
            Dim Rate_MobBodyDrop As Single

            Dim Enable_MobDrops As Boolean

            Dim Enable_PKBagDrop As Boolean
            Dim Enable_PKBodyDrop As Boolean
            Dim Rate_PKBagDrop As Single
            Dim Rate_PKBodyDrop As Single

            Dim Rate_ExpMultiplier As Integer
            Dim Rate_DropMultiplier As Integer

            Dim Max_Level As Integer

        End Structure

        Public ServerSettings As New Globals.ServerOptions

        Public ServerName As String

        Public sServerPath As String
        Public UpSince As DateTime

        'enables debug output
        Public bDebugMode As Boolean '= True

        Public bShutdown As Boolean
        'TODO: Implement (real) Maintainance mode
        Public bUnderMaintainance As Boolean = True

        Public iFPS As Integer
        Public sInput As String = ""

        Public ServerListenIP As System.Net.IPAddress
        Public ServerPort As Integer

        Public UDPBroadcastPort As Integer
        Public HTTPPort As Integer

        Public ServerTimeZone As String

        Public MaxLoginAttempts As Integer
        Public LockTime As Integer

        Public iniServer As IniFile

        Public Structure ServerDesc

            Dim Name As String

            Dim Hostname As String
            Dim Port As Integer

        End Structure

        Public colServers As New Dictionary(Of String, ServerDesc)
        Public isLoginServer As Boolean

        Public Sub AddServer(desc As ServerDesc)

            colServers.Add(desc.Name, desc)

        End Sub

        Public Function GetServerSwitcher(name As String) As SwitchServer

            If Not colServers.ContainsKey(name) Then Return Nothing

            Dim switch As SwitchServer
            switch.STR_HOSTNAME = colServers(name).Hostname
            switch.INT_PORT = colServers(name).Port

            Return switch

        End Function

    End Module

End Namespace
